<!--
 * @Author: 18970328563 2726167793@qq.com
 * @Date: 2023-03-15 22:59:46
 * @LastEditors: 18970328563 2726167793@qq.com
 * @LastEditTime: 2023-04-04 23:02:19
 * @FilePath: \vant_admin\src\App.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup>
import tabBar from '@/components/tabBar.vue'
import { ref} from 'vue';
import { useRouter } from 'vue-router'


const navBarData = [
    { name: '首页', icon: 'wap-home', path: 'index' },
    { name: '分类', icon: 'wap-nav', path: 'type' },
    { name: '购物车', icon: 'shopping-cart', path: 'buy' },
    { name: '我的', icon: 'friends', path: 'mine' },
]
const navList = ref(navBarData)
const active = (index) => {
router.push({
    name: navList.value[index].path,
})
}
const router = useRouter()

</script>

<template>
    <div class="test">
        <router-view></router-view>
        <tabBar :navList="navList" @active="active" :index="index"></tabBar>
    </div>
</template>

<style scoped lang="scss">
.test {
   
}
</style>
